home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / v cisle / htttrack / httrack-3.41-3.exe / {app} / src / htsbauth.h < prev    next >
C/C++ Source or Header  |  2006-05-20  |  3KB  |  88 lines

  1. /* ------------------------------------------------------------ */
  2. /*
  3. HTTrack Website Copier, Offline Browser for Windows and Unix
  4. Copyright (C) Xavier Roche and other contributors
  5.  
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU General Public License
  8. as published by the Free Software Foundation; either version 2
  9. of the License, or any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this program; if not, write to the Free Software
  18. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  19.  
  20.  
  21. Important notes:
  22.  
  23. - We hereby ask people using this source NOT to use it in purpose of grabbing
  24. emails addresses, or collecting any other private information on persons.
  25. This would disgrace our work, and spoil the many hours we spent on it.
  26.  
  27.  
  28. Please visit our Website: http://www.httrack.com
  29. */
  30.  
  31. /* ------------------------------------------------------------ */
  32. /* File: httrack.c subroutines:                                 */
  33. /*       basic authentication: password storage                 */
  34. /* Author: Xavier Roche                                         */
  35. /* ------------------------------------------------------------ */
  36.  
  37.  
  38.  
  39. #ifndef HTSBAUTH_DEFH
  40. #define HTSBAUTH_DEFH 
  41.  
  42. // robots wizard
  43. #ifndef HTS_DEF_FWSTRUCT_bauth_chain
  44. #define HTS_DEF_FWSTRUCT_bauth_chain
  45. typedef struct bauth_chain bauth_chain;
  46. #endif
  47. struct bauth_chain {
  48.   char prefix[1024];          /* www.foo.com/secure/ */
  49.   char auth[1024];            /* base-64 encoded user:pass */
  50.   struct bauth_chain* next;   /* next element */
  51. };
  52.  
  53.  
  54. // buffer pour les cookies et authentification
  55. #ifndef HTS_DEF_FWSTRUCT_t_cookie
  56. #define HTS_DEF_FWSTRUCT_t_cookie
  57. typedef struct t_cookie t_cookie;
  58. #endif
  59. struct t_cookie {
  60.   int max_len;
  61.   char data[32768];
  62.   bauth_chain auth;
  63. };
  64.  
  65.  
  66. /* Library internal definictions */
  67. #ifdef HTS_INTERNAL_BYTECODE
  68.  
  69. // cookies
  70. int cookie_add(t_cookie* cookie,char* cook_name,char* cook_value,char* domain,char* path);
  71. int cookie_del(t_cookie* cookie,char* cook_name,char* domain,char* path);
  72. int cookie_load(t_cookie* cookie, const char* path, const char* name);
  73. int cookie_save(t_cookie* cookie,char* name);
  74. void cookie_insert(char* s,char* ins);
  75. void cookie_delete(char* s,int pos);
  76. char* cookie_get(char *buffer, char* cookie_base,int param);
  77. char* cookie_find(char* s,char* cook_name,char* domain,char* path);
  78. char* cookie_nextfield(char* a);
  79.  
  80. // basic auth
  81. int bauth_add(t_cookie* cookie,char* adr,char* fil,char* auth);
  82. char* bauth_check(t_cookie* cookie,char* adr,char* fil);
  83. char* bauth_prefix(char *buffer, char* adr,char* fil);
  84.  
  85. #endif
  86.  
  87. #endif
  88.